
using System;


namespace Flit.Samples.GivenWhenThen
{
	public partial class Story : FluentStateBase
	{
		
		public Story(string title){
			this.Title = title;
		}
		
		#region Data
		public string Title {get;set;}
		#endregion
		
	
		#region Actions
		
		partial void OnGiven(string text, Action action);
		public Condition Given(string text, Action action) 
		{
			Condition __newFragment = new Condition(text, action);
			Children.Add(__newFragment);
			__newFragment.Parent=this;
			OnGiven(text, action);
			return __newFragment;
		}
		
		#endregion

		#region VisitCallback
		
		public override void VisitCallback(IFragmentVisitor v)
		{
			v.Visit(this);
		}
		
		#endregion
	}
	public partial class Condition : FluentStateBase
	{
		
		public Condition(string text, Action action){
			this.Text = text;
			this.Action = action;
		}
		
		#region Data
		public string Text {get;set;}
		public Action Action {get;set;}
		#endregion
		
	
		#region Actions
		
		partial void OnAnd(string text, Action action);
		public Condition And(string text, Action action) 
		{
			Condition __newFragment = new Condition(text, action);
			Children.Add(__newFragment);
			__newFragment.Parent=this;
			OnAnd(text, action);
			return __newFragment;
		}
		
		
		partial void OnWhen(string text, Action action);
		public Operation When(string text, Action action) 
		{
			Operation __newFragment = new Operation(text, action);
			Children.Add(__newFragment);
			__newFragment.Parent=this;
			OnWhen(text, action);
			return __newFragment;
		}
		
		#endregion

		#region VisitCallback
		
		public override void VisitCallback(IFragmentVisitor v)
		{
			v.Visit(this);
		}
		
		#endregion
	}
	public partial class Operation : FluentStateBase
	{
		
		public Operation(string text, Action action){
			this.Text = text;
			this.Action = action;
		}
		
		#region Data
		public string Text {get;set;}
		public Action Action {get;set;}
		#endregion
		
	
		#region Actions
		
		partial void OnAnd(string text, Action action);
		public Operation And(string text, Action action) 
		{
			Operation __newFragment = new Operation(text, action);
			Children.Add(__newFragment);
			__newFragment.Parent=this;
			OnAnd(text, action);
			return __newFragment;
		}
		
		
		partial void OnThen(string text, Action action);
		public Outcome Then(string text, Action action) 
		{
			Outcome __newFragment = new Outcome(text, action);
			Children.Add(__newFragment);
			__newFragment.Parent=this;
			OnThen(text, action);
			return __newFragment;
		}
		
		#endregion

		#region VisitCallback
		
		public override void VisitCallback(IFragmentVisitor v)
		{
			v.Visit(this);
		}
		
		#endregion
	}
	public partial class Outcome : FluentStateBase
	{
		
		public Outcome(string text, Action action){
			this.Text = text;
			this.Action = action;
		}
		
		#region Data
		public string Text {get;set;}
		public Action Action {get;set;}
		#endregion
		
	
		#region Actions
		
		partial void OnAnd(string text, Action action);
		public Outcome And(string text, Action action) 
		{
			Outcome __newFragment = new Outcome(text, action);
			Children.Add(__newFragment);
			__newFragment.Parent=this;
			OnAnd(text, action);
			return __newFragment;
		}
		
		#endregion

		#region VisitCallback
		
		public override void VisitCallback(IFragmentVisitor v)
		{
			v.Visit(this);
		}
		
		#endregion
	}

	public interface IFragmentVisitor
	{
		void Visit(Story fragment);
		void Visit(Condition fragment);
		void Visit(Operation fragment);
		void Visit(Outcome fragment);
	}
}